package cn.lenchu.data.dao;

import cn.lenchu.data.model.User;

/**
 * @author lenchu
 */
public interface UserDao {

    /**
     * 通过 id 查找用户
     * @param id id
     * @return User
     */
    User findById(Integer id);

    /**
     * 通过 email 查找用户
     * @param email email
     * @return User
     */
    User findOneByEmail(String email);

    /**
     * 通过 mobile 查找用户
     * @param mobile mobile
     * @return User
     */
    User findOneByMobile(String mobile);

    /**
     * 添加或更新用户
     * @param user user
     * @return User
     */
    User upsert(User user);
}
